package com.common.test;

	/**
		@author 王嘉犇
		@name 后台登录
		@type 动作类
	 */

public class BackEndLogin extends OperationBase {
	
	public boolean ispageContains = false;
	
    public BackEndLogin(UITestBase tb){
        super(tb);
    }
    
    public void login(String username, String password) throws Exception{
    	log.info("===start login Operation===");
        BackEndLoginPage belp = new BackEndLoginPage(tb);
        switchToDefaultContent();
        waitForElementExist(belp.accountinput);
        belp.accountinput.type(username);
        pause(1000);
        belp.passwordinput.clear();
        belp.passwordinput.type(password);
        pause(1500);
        belp.loginbutton.submit();
        log.info("===end login Operation===");
        ispageContains = isPageContainsStr("钜宝盆");
        if(!ispageContains){
        	return;
        }
    }
}
